cmake_minimum_required (VERSION 3.26)
project(EngineProject VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 20)



#build MainModule as a dll

#iterate through all the files in the MainModule folder and add them to the source files
file(GLOB_RECURSE MainModuleSourceFiles ${CMAKE_CURRENT_LIST_DIR}/Source/MainModule/*.cpp)
add_library(ProjectTemplateMainModule SHARED ${MainModuleSourceFiles})
target_link_libraries(ProjectTemplateMainModule PUBLIC EngineCore)

if(WIN32)
    target_compile_definitions(ProjectTemplateMainModule PRIVATE "BUILD_PROJECT_MAINMODULE")
endif()
#set DEBUG Macro
target_compile_definitions(ProjectTemplateMainModule PRIVATE "$<$<CONFIG:DEBUG>:DEBUG>")



#build project as a executable 
set(ProjectSourceFiles 
    ${CMAKE_CURRENT_LIST_DIR}/Source/main.cpp
)

set(EXECUTEBLE_NAME ScriptProjectTemplate)

add_executable(${EXECUTEBLE_NAME} ${ProjectSourceFiles})
target_link_libraries(${EXECUTEBLE_NAME} PUBLIC ProjectTemplateMainModule)

#set DEBUG Macro
target_compile_definitions(${EXECUTEBLE_NAME} PRIVATE "$<$<CONFIG:DEBUG>:DEBUG>")

